import request from '@/utils/request'

// 查询采购管理列表
export function listPurchaseOrder(query) {
  return request({
    url: '/medicine/purchaseOrder/list',
    method: 'get',
    params: query
  })
}

// 查询采购管理详细
export function getPurchaseOrder(id) {
  return request({
    url: '/medicine/purchaseOrder/' + id,
    method: 'get'
  })
}

// 新增采购管理
export function addPurchaseOrder(data) {
  return request({
    url: '/medicine/purchaseOrder',
    method: 'post',
    data: data
  })
}

// 修改采购管理
export function updatePurchaseOrder(data) {
  return request({
    url: '/medicine/purchaseOrder',
    method: 'put',
    data: data
  })
}

// 删除采购管理
export function delPurchaseOrder(id) {
  return request({
    url: '/medicine/purchaseOrder/' + id,
    method: 'delete'
  })
}

// 导出采购管理
export function exportPurchaseOrder(query) {
  return request({
    url: '/medicine/purchaseOrder/export',
    method: 'get',
    params: query
  })
}

export function computeCostPriceTotal(data) {

  return request({
    url: "/medicine/purchaseOrder/costPrice",
    method: "post",
    data
  })
}
